<?php

use Illuminate\Routing\Router;

Route::group([
    'prefix'     => 'admin/Constant',
    'namespace'  => 'Buu\\Modules\\Constant\\Controllers',
    'middleware' => [
        'web',
        'admin'
    ],
], function (Router $router) {
    $router->get('constant-type/list', 'ConstantTypeController@index');

    $router->put('constant-type/list/{id}', 'ConstantTypeController@listsave');

    $router->get('constant-type/add', 'ConstantTypeController@add');
    $router->post('constant-type/addsave/', 'ConstantTypeController@addsave');


//    $router->resource('constant-value', ConstantValueController::class);
    $router->get('constant-value/list/{id}', 'ConstantValueController@index');
    $router->get('constant-value-group/list/{id}', 'ConstantValueGroupController@index');

    $router->put('constant-value/list/{cid}/{vid}', 'ConstantValueController@listsave');



    $router->get('constant-value-group/add/{id}', 'ConstantValueGroupController@add');
    $router->post('constant-value-group/addsave/', 'ConstantValueGroupController@addsave');

    $router->put('constant-value-group/list/{id}/{gid}', 'ConstantValueGroupController@listsave');

//    $router->get('constant-value-group/detail/{id}', 'ConstantValueGroupController@detail');


//    $router->resource('constant-value-group', ConstantValueGroupController::class);
//    $router->resource('constant-value-group-relation', ConstantValueGroupRelationController::class);


//    $router->get('constant-value/list/{id}', ConstantValueController::class.'@getList');

    $router->get('constant-type/detail/{id}', 'ConstantTypeController@detail');

    $router->get('constant-value/add/{id}', 'ConstantValueController@add');
    $router->post('constant-value/addsave/', 'ConstantValueController@addsave');


    $router->get('constant-value-group-relation/addnew/{id}/{gid}', 'ConstantValueGroupRelationController@addnew');
    $router->post('constant-value-group-relation/addsave/', 'ConstantValueGroupRelationController@addsave');


    $router->get('constantgroup/getConstantGroup', ConstantValueGroupController::class.'@getConstantGroup');
    $router->get('constantvalue/getConstantValue', ConstantValueController::class.'@getConstantValue');
    $router->get('constant-version', 'ConstantVersionController@index');
    $router->post('constant-version/addsave/', 'ConstantVersionController@addsave');
});

